Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

refactor($interval): do not use notify to trigger the callback #13261

Closed
wants to merge 1 commit into from

Conversation

lgalfaso
Copy link
Contributor

@lgalfaso lgalfaso commented Nov 5, 2015

Do not use $q.notify to trigger the callback. This allows $q to be replaced
with another Promise/A+ compilant library

Note: this PR is not enough to close #12533, but should solve the main issue in trying to use Bluebird as a replacement of $q

@Narretz
Copy link
Contributor

Narretz commented Nov 6, 2015

If we are making this change to support a specific use case, shouldn't we add a test for that behavior? Otherwise someone else might refactor this back to what it was, and it would break again,

@lgalfaso
Copy link
Contributor Author

lgalfaso commented Nov 8, 2015

@Narretz done!

promise.$$intervalId = setInterval(function tick() {
if (intervals[promise.$$intervalId]) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this check needed ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right

Do not use `$q.notify` to trigger the callback. This allows `$q` to be replaced
with another Promise/A+ compilant library
@lgalfaso lgalfaso closed this in e527559 Nov 17, 2015
gkalpak pushed a commit to gkalpak/angular.js that referenced this pull request Nov 23, 2015
Do not use `$q.notify` to trigger the callback. This allows `$q` to be replaced
with another Promise/A+ compilant library

Closes: angular#13261
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Drop non-compliant Promises/A+ progress/notify on $q
4 participants